A database stores data in a logical format exposed to external entities (e.g., users and applications) as rows and columns. The data in the database is accessed through a database management system (DBMS) that accepts “database queries” in a standard language such as SQL. The standard language provides clauses that allow a user to access rows of database objects (e.g., a table or index) based on data items that may be in a specific columns of a particular database object. Database queries can include many kinds of clauses that declare different kinds of operations, such as aggregations, joins, inserts, updates, or deletions of rows. A specific type of clause is a recursive clause.
A certain type of query is a query with a recursive clause. A query with a recursive clause requires multiple iterations to execute, and the results from a previous iteration are used to execute the next iteration. Typically, the process uses a private buffer cache to store the intermediate result set of a previous iteration in order to perform a database operation for the current iteration. When multiple processes are needed to execute a query in parallel, the intermediate results in a private buffer are only available to the process that generated results for that buffer. Thus, a process can only work on the results that it buffers and not results produced by another process. For this reason, a query with a recursive clause is typically only executed by a single process. Unfortunately, executing a query with a recursive clause using only a single process creates a bottleneck in query execution.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.